import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_file_downloader/flutter_file_downloader.dart';
import 'package:flutter_file_downloader/flutter_file_downloader_platform_interface.dart';
import 'package:flutter_file_downloader/flutter_file_downloader_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterFileDownloaderPlatform
    with MockPlatformInterfaceMixin
    implements FlutterFileDownloaderPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterFileDownloaderPlatform initialPlatform = FlutterFileDownloaderPlatform.instance;

  test('$MethodChannelFlutterFileDownloader is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterFileDownloader>());
  });

  test('getPlatformVersion', () async {
    FlutterFileDownloader flutterFileDownloaderPlugin = FlutterFileDownloader();
    MockFlutterFileDownloaderPlatform fakePlatform = MockFlutterFileDownloaderPlatform();
    FlutterFileDownloaderPlatform.instance = fakePlatform;

    expect(await flutterFileDownloaderPlugin.getPlatformVersion(), '42');
  });
}
